package com.rookie.im.utils.enums;

import lombok.Getter;

@Getter
public enum CommandType {

    USER("4"),
    FRIEND("3"),
    GROUP("2"),
    MESSAGE("1"),
    SYSTEM("9");
	
    private final String commandType;
    CommandType(String commandType) {
        this.commandType = commandType;
    }
    
    public static CommandType genCommnadeType(int command) {
    	String flag = String.valueOf(command).substring(0, 1);
    	for(CommandType val: CommandType.values()) {
    		if (val.getCommandType().equals(flag)) {
    			return val;
    		}
    	}
    	return MESSAGE;
    }

}
